package com.iplant.mes.service.mesenum.bcm;

import com.iplant.base.po.enums.BaseEnum;

/**
 * 条码规则项类型
 *
 * @author femi
 * @CreateTime 2020-1-19 11:09:21
 * @date  2023-8-30 11:09:25
 */
public enum BCMRuleItemTypes implements BaseEnum {
    /**
     * 默认 固定值
     */
    Default(0, "默认","__"),
    /**
     * 工厂代码
     */
    Factory(1, "工厂代码","__"),
    /**
     * 订单
     */
    Order(2, "订单","__"),
    /**
     * 产品
     */
    Product(3, "产品","__"),

    /**
     * 序列号
     */
    Sequence(4, "序列号","__"),
    /**
     * 日期
     */
    Date(5, "日期","yyMMdd"),
    /**
     * 产品
     */
    ProductSimplified(6, "产品代码","__");

    private int value;
    private String label;
    private String remark;

    BCMRuleItemTypes(int value, String label,String remark) {
        this.value = value;
        this.label = label;
        this.remark = remark;
    }

    /**
     * 通过 value 的数值获取枚举实例
     *
     * @param val  int
     * @return BCMRuleItemTypes
     */
    public static BCMRuleItemTypes getEnumType(int val) {
        for (BCMRuleItemTypes type : BCMRuleItemTypes.values()) {
            if (type.getValue() == val) {
                return type;
            }
        }
        return Default;
    }

    public int getValue() {
        return value;
    }

    public String getLabel() {
        return label;
    }

    @Override
    public void setValue(int wValue) {
        this.value=wValue;
    }

    @Override
    public void setLabel(String wLabel) {
        this.label = wLabel;
    }

    public String getRemark() {
        return remark;
    }

    @Override
    public void setRemark(String remark) {
        this.remark = remark;
    }
}
